Creating Google App Engine

In the last lesson, we looked at the Cloud Run hello world deployment. As it is a managed service we just had to focus on packaging our code correctly and then it is piece of cake to deploy it.

In this lesson, we will learn about one more serverless platform App Engine. This is a managed environment for developers who wanted to deploy code from their IDE itself. Google launched the App engine in 2008 at that time it was a great tool for developers to have a one-click deployment thing. So, we will take a brief look at App Engine.

Introduction#

App Engine is totally focused platform for application development over HTTP/HTTPS. App Engine supports application running on these protocols only. GCP launched App Engine as its first cloud product in 2008. Also, remember you can have only one App Engine per project.

App Engine is “Platform As A Service” offering from GCP. You can create/code web applications using GCP’s App Engine and don’t have to manage the infrastructure for hosting it on GCP. Let’s talk about the different features it has.

Functionalities#

App Engine provides many application development functionalities which are required for web development or mobile backend development.

  • Application Versioning: App engine maintains different versions of your app.

  • Traffic Splitting: You can split traffic to different versions of your application to test it with targeted users. Use --no-promote flag while deploying. This will ensure that the traffic is not forwarded to the latest code and then you can use split traffic feature to do canary testing.

  • Caching: App Engine has inbuilt support for caching static assets.

  • Local dev server: A local dev server is just one command away.

With the App Engine, you pay only for what you use. No additional or maintenance cost is charged.

Keep in mind that, When you use App Engine Google’s NoSQL database Datastore (Now Firestore) is the prefered choice for the app engine database.

Types#

App Engine comes with 2 types of Environments.

  1. Standard environment
  2. Flexible environment

Let’s look at both of them in detail.

Standard environment#

This is the first one with which Google launched there the first version of App Engine. The App Engine standard environment is based on container instances running on Google’s infrastructure. Containers are preconfigured with one of several available runtimes.

There are some predefined instance classes and categorized as “F” and “B” (Frontend and Backend). Well, we don’t have to worry about them as they are handled by Google when auto-scaling the app. But Google provides an option to override these default settings.

Runtimes supported:

  1. Node
  2. PHP
  3. Python
  4. Java
  5. Ruby
  6. Go
  7. .NET

Well, the standard environment has some limitations like,

  • No SSH
  • No 3rd party binaries
  • No Write to Local Disk
  • And obviously no custom runtimes.

So, to overcome this we have another environment.

Flexible environment#

Keeping in mind the enterprise requirement, Google Cloud launched the next version of App Engine to provide custom runtimes along with the standard ones.

Features of Flexible Environment are:

  • Standard runtimes plus custom runtime using the open-source approved Dockerfile.

  • Option to specify infrastructure needs such as CPU and memory.

  • All the features supported in Standard Environment.

You can have only one App per project. And you cannot delete an App once it is created. You can only disable it.

Structure#

To provide all these features, App Engine uses one structure to organize things. App Engine has Service, Versions and then instances.

You can use services to deploy your app as a set of microservices, making your app components independent and modular. Each service can have different Versions, runtimes and performance settings.

And App Engine uses different instances to host the app. We may or may not use instance tab depending upon the environment we choose.

Demo#

Let’s have a quick demo of the App Engine so that you can explore the app engine in detail.

  1. Open Main menu > App Engine.

  2. It will show you an option to “Create Application”.

Google App Engine dashboard
Google App Engine dashboard
  1. Once you click on it, you need to select a region where your app will be hosted. This will be permanent and you cannot change the location afterward.
Select the region for app. This will be permanent change.
Select the region for app. This will be permanent change.
  1. Choose the language and environment type. For now, choose standard.
Select the Python for language input and "Standard" for environment.
Select the Python for language input and "Standard" for environment.
  1. Click on the App Engine quickstart link and select Python language. Follow the tutorial provided in the right-side pane.
widget
Follow this self help quickstart tutorial of app engine.
Follow this self help quickstart tutorial of app engine.

That’s it. The next steps are done with cloud shell or local Google SDK CLI. I would suggest using Google cloud shell.

To practice more refer to the below code labs.

Labs#

So, this was a brief introduction to App Engine. Make sure to disable the app engine once you are done. With this, we are left with the last compute offering which is Cloud Function. It has very little to discuss also explaining cloud function alone is not enough. So, we will cover it in the upcoming demo sections.

With that said, we are at the end of Compute Services. In the next lesson, we will see a small decision chart. Google is crazy about charts. To simplify the decision-making process for available services Google Cloud has created many decision charts. We will look at one of them for Compute services.

Introduction to Cloud Run

Decision Chart